Manuals - Using the Windows XP Recovery Console

There is a common misconception that NTFS volumes cannot be accessed from the command line, and that you're in a mess if you can't boot into XP.
This is not true. The Windows XP Recovery Console can be used to modify files from the command line if you can't boot into Windows, even on NTFS partitions. This guide describes how the Recovery Console can be used.

What can you do from the Recovery Console?
You can enable and disable services, format drives, repair the boot record, read and write data on a local drive (including drives that are formatted to use the NT File System (NTFS), and perform many other administrative tasks.

NOTE: By default, the Recovery Console allows you to access only the root folder, the WINDOWS folder (and it's subfolders), and removable drives such as the CD-ROM. Also, it will not allow you to copy files to removable media such as floppies. However, you can make some changes that will allow you to access all folders on your drives, as well as copy files to removable media. Follow the steps below:

Allow Access to all folders and removable media:
1. Click Start, click Run, type mmc in the Open box, and then click OK.
2. On the File menu, click Add/Remove Snap-in, and then click Add.
3. Click Group Policy, and then click Add.
4. Click Local Computer, click Finish, and then click Close to return to the Add/Remove Snap-in dialog box.
5. Click OK to return to the Console window.
6. Expand the Local Computer Policy object to Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options.
7. Select the Security Options object in the Console pane to display the security policies in the Details pane.
8. In the Details pane, double-click the Recovery Console: Allow Floppy Copy And Access To All Drives And Folders policy.
9. Click Enabled, and then click OK.

How to get into the Recovery Console:
1. Insert the Windows XP CD-ROM into the CD-ROM drive, and then restart the computer. Click to select any options that are required to start the computer from the CD-ROM drive if you are prompted to do so.
2. When the "Welcome to Setup" screen appears, press R to start the Recovery Console.
3. When the Recovery Console menu is displayed, a numbered list of the Windows installations on the computer is displayed (usually only one entry-c:\Windows-exists). Press a number before you press ENTER, even when only one entry appears. If you press ENTER without choosing a number, the computer restarts and begins the process again.
4. When you are prompted to do so, type the Administrator password. If the administrator password is blank, just press ENTER.

If you followed the steps above to allow access to all folders and removable media, you need to perform one extra step. At the command prompt type:
set AllowAllPaths = TRUE
set AllowRemovableMedia = TRUE
set AllowWildCards = TRUE

Make sure there is a space before and after the = sign, or you will encounter a syntax error!

List of commands that can be used in the Console:
For a list of commands that are available in Recovery Console, type help at the command prompt, and then press ENTER.
For information about a specific command, type help <commandname> at the command prompt, and then press ENTER.

Here's a list of commands that can be used:
* Attrib changes attributes on one file or subdirectory.
* Batch executes commands that you specify in the text file, Inputfile; Outputfile holds the output of the commands. If you omit the Outputfile parameter, output is displayed on the screen.
* Bootcfg is used to manipulate the Boot.ini for boot configuration and recovery.
* CD (Chdir) operates only within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources.
* Chkdsk The /p switch runs Chkdsk even if the drive is not flagged as dirty. The /r switch locates bad sectors and recovers readable information; this switch implies /p. Chkdsk requires Autochk. Chkdsk automatically looks for Autochk.exe in the startup (or boot) folder. If Chkdsk cannot find the file in the startup folder, it looks for the Windows 2000 Setup CD-ROM. If Chkdsk cannot find the installation CD-ROM, it prompts the user for the location of Autochk.exe.
* Cls clears the screen.
* Copy copies one file to a target location. By default, the target cannot be removable media and you cannot use wildcards. Copying a compressed file from the Windows 2000 Setup CD-ROM automatically decompresses the file.
* Del (Delete) deletes one file. Operates within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources. You cannot use wildcards by default.
* Dir displays a list of all files, including hidden and system files.
* Disable disables a Windows system service or driver. The variable service_or_driver is the name of the service or driver that you want to disable. When you use this command to disable a service, it displays the service's original startup type before changing the type to SERVICE_DISABLED. You should note the original startup type so that you can use the enable command to restart the service.
* Diskpart manages partitions on hard disk volumes. The /add option creates a new partition; the /delete option deletes an existing partition. The variable device is the device name for a new partition (such as \device\harddisk0). The variable drive is the drive letter for a partition that you are deleting (for example, D); partition is the partition-based name for a partition that you are deleting, (for example: \device\harddisk0\partition1) and can be used in place of the drive variable. The variable size is the size, in megabytes, of a new partition.
* Enable enables a Windows system service or driver.
* Fixboot writes a new boot sector on the system partition.
* Fixmbr repairs the boot partition's master boot code. The variable device is an optional name that specifies the device that needs a new MBR; omit this variable when the target is the boot device.
* Format formats a disk. The /q switch performs a quick format; the /fs switch specifies the file system.
* Help If you do not use the command variable to specify a command, help lists all the commands that the Recovery Console supports.
* Listsvc displays all available services and drivers on the computer.
* Logon displays detected installations of Windows and requests the local Administrator password for those installations. Use this command to move to another installation or subdirectory.
* Map displays currently active device mappings. Include the arc option to specify the use of Advanced RISC Computing (ARC) paths (the format for Boot.ini) instead of Windows device paths.
* MD (Mkdir) operates only within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources.
* More (or Type) displays the specified text file (such as, filename) on screen.
* Net Use connects to a remote share for the Windows XP Recovery Console.
* Rd (Rmdir) operates only within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources.
* Ren (Rename) operates only within the system directories of the current Windows installation, removable media, the root directory of any hard disk partition, or the local installation sources. You cannot specify a new drive or path as the target.
* Set displays and sets the Recovery Console environment variables.
* Systemroot sets the current directory to %SystemRoot%.


Author:

Lex van der Horst

Date Added:

06-11-2004

Last Reviewed:

06-11-2004